package com.belf.evaluatetool.web;

import belf.migrate.api.taskconf.SourceConf;
import belf.migrate.engine.job.Result;
import com.belf.evaluatetool.service.DatabaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * DatabaseController
 *
 * @author l
 * @since 2024/10/28 11:44
 */
@RestController
@RequestMapping("/database")
public class DatabaseController {

    @Autowired
    private DatabaseService databaseService;

    @PostMapping("/connectCheck")
    @ResponseBody
    public Result databaseCheck(@RequestBody SourceConf sourceConf){

        return databaseService.checkDatabase(sourceConf);
    }
}
